<template>
  <div class="common-layout">
    <el-container>
      <el-aside
        :width="homeStore.isCollapse ? '64px' : '200px'"
        style="transition: all 0.4s"
      >
        <h2>嗨购管理系统</h2>

        <Menu />
      </el-aside>
      <el-container direction="vertical">
        <Top />
        <el-main>
          <Breadcrumb />
          <RouterView />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script lang="ts" setup>
import Menu from "./components/Menu.vue";
import Top from "./components/Header.vue";
import Breadcrumb from "./components/Breadcrumb.vue";
import { useHomeStore } from "@/stores/home";

const homeStore = useHomeStore();
</script>

<style lang="less" scoped>
.el-container {
  min-height: 100vh;

  .el-aside {
    background-color: #001529;

    h2 {
      margin: 20px;
      font-size: 24px;
      line-height: 40px;
      height: 40px;
      text-align: center;
      background-color: rgba(255, 255, 255, 0.3);
      color: #fff;
      white-space: nowrap;
      overflow: hidden;
    }
  }

  .el-header {
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}
</style>
